<%@page import="org.springframework.context.ApplicationContext"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="erp.education.server.db.entites.user.Credentials,java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User Details</title>
<script type="text/javascript">
function updateUserTheme(){
	 
	$.post( "updateUserTheme.action", { themeName: $("select[name='themeName'] option:selected").val() } ).done(function(data){
		//$("#statusUpdate").html(data);		
		location.reload(); 
														});
}
function moduleSelect(){
window.location=$("select[id='moduleNav'] option:selected").val();
}
<%if(null==session.getAttribute("user")){%>
window.location="login.action";
<%}%>
</script>
</head>
<body>
<form name="userDetails"  action="updateUserTheme.action" method="post">
<table width="100%" align="right">
<%
Credentials user=(Credentials)session.getAttribute("user");
List<String> themes=(List<String>)getServletConfig().getServletContext().getAttribute("uiThemes");
%>
<tr><td width="20">
<span class="ui-icon ui-icon-person"></span></td><td width="200"><%=user.getAuthenticationName()%></td> <td width="150">Last login:</td><td width="100"></td><td></td> <td width="150">Themes:</td><td width="150"><select class='combobox' name="themeName" onChange="updateUserTheme()"><option value="-1">-Select-</option>
<%
for(String theme:themes){
%>
<option value="<%=theme%>"><%=theme.toUpperCase() %></option>
<% }%>
</select></td><td>Module:</td><td>
<select id="moduleNav" onchange="moduleSelect()">
<option value="admission.action">Admission</option>
<option value="finance.action">Finance</option>
<option value="student.action">Student</option>
<option value="transport.action">Transport</option>
<option value="hostel.action">Hostel</option>
<option value="library.action">Library</option>
<option value="attendance.action">Attendance</option>
<option value="academics.action">Academics</option>
<option value="reminders.action">Reminders</option>
<option value="themens.action">Themes</option>
<option value="setup.action">Setup</option>
<option value="profile.action">Profile</option>
</select></td><td width="20"><a href="home.action"><span class="ui-icon ui-icon-home"></span></a></td><td width="20"><a href="logout.action"><span class="ui-icon ui-icon-power"></span></a></td></tr></table>
</form>
<script>
$("select[name='themeName']").val("<%=session.getAttribute("cssView")%>");
</script>
</body>
</html>